/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package connexion;

import java.sql.*;

/**
 *
 * @author asall
 */
public class Connexion {
    static Connection con=null;
    static String url = "jdbc:oracle:thin:@localhost:1521:xe";
    static String user = "asall";
    static  String passwd = "asall";
    Statement statement;

	public static Connection getInstance(){
		if(con == null){
			try {
                               Class.forName("oracle.jdbc.driver.OracleDriver");
			        System.out.println("DRIVER OK ! ");
				con = DriverManager.getConnection(url, user, passwd);
                                System.out.println("connexion OK");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}		
		return con;	
	}
}
